package com.selftest.anno;

import java.lang.annotation.Annotation;

public class AnnoTest {

    public static void main(String[] args) {

        System.out.println("获取注解");
        System.out.println("    Prople 类");
        Class<People> peopleClass = People.class;
        Annotation[] annotations1 = peopleClass.getAnnotations();
        for (Annotation annotation : annotations1) {
            System.out.println(annotation.toString());
        }
        System.out.println("    Student 类");
        Class<Student> studentClass = Student.class;
        Annotation[] annotations = studentClass.getAnnotations();
        for (Annotation annotation : annotations) {
            System.out.println(annotation.toString());
        }
    }

}
